const express = require('express')
const router = express.Router()
const expressJoi = require('@escook/express-joi')
const userHandler = require('../router_handle/userInfo')
const {
	email_limit,
	name_limit,
	password_limit,
	forgetPassword_limit
} = require('../limit/user.js')
// 上传头像
router.post('/uploadAvatar', userHandler.uploadAvatar)
router.post('/bindAccount', userHandler.bindAccount)
router.post('/getUserInfo', userHandler.getUserInfo)
router.post('/changeName', expressJoi(name_limit), userHandler.changeName)
router.post('/changeSex', userHandler.changeSex)
router.post('/changeEmail', expressJoi(email_limit), userHandler.changeEmail)
router.post('/changePassword', expressJoi(password_limit), userHandler.changePassword)
router.post('/verifyAccountAndEmail', userHandler.verifyAccountAndEmail)
router.post('/changePasswordInLogin', expressJoi(forgetPassword_limit), userHandler.changePasswordInLogin)

module.exports = router